﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using SelfService.Model.Models;


namespace SelfService.ViewModel.SysPayTypeVMs
{
    public partial class SysPayTypeListVM : BasePagedListVM<SysPayType_View, SysPayTypeSearcher>
    {

        protected override IEnumerable<IGridColumn<SysPayType_View>> InitGridHeader()
        {
            return new List<GridColumn<SysPayType_View>>{
                this.MakeGridHeader(x => x.Name),
                this.MakeGridHeaderAction(width: 200)
            };
        }

        public override IOrderedQueryable<SysPayType_View> GetSearchQuery()
        {
            var query = DC.Set<SysPayType>()
                .Select(x => new SysPayType_View
                {
				    ID = x.ID,
                    Name = x.Name,
                })
                .OrderBy(x => x.ID);
            return query;
        }

    }

    public class SysPayType_View : SysPayType{

    }
}
